package adminController

import (
	"gin/chibuda/app/admin/adminService"
	"gin/chibuda/app/admin/adminValidate"
	"gin/chibuda/app/utils"
	"github.com/gin-gonic/gin"
)

func Login(c *gin.Context){
	input:=utils.Input(c)
	if err:= adminValidate.LoginValidate(input,"login");err!=""{
		c.JSON(utils.ErrCode, gin.H{"msg": err})
		return
	}
	r := adminService.Login(input)
	c.JSON( r.HttpCode, r.Rs)
}